<html>
<head>
<title>DIGI-Infomat</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<link href="style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        .style1
        { width: 20%;}
    </style>
</head>
<?php
	include "uploader.php";
	include "xutility.php";
	$xUploader = new Uploader ();
	$xUtility = new XUtility();
        
    if (!empty($_POST)) {
       //echo "<pre>";
       //print_r($_POST);
       //echo "</pre>";
       $btn = $_POST['btn'];
           
		switch ($btn) 
		{
		case "upload" :
		    $xUploader->upload($_FILES['choose_file'] ,'firmware');
			break;
		case "reboot" :
		    $xUtility->reboot();
			break;
		}
    }
?>
<form name="updateForm" method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="text-align:center">
<table width="100%"> 
<tr>
   <td align="center">
        <table width="780px" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <table border="0" bgcolor="#FFFFFF" width="100%">
						<tr>
                            <td rowspan="2" width="20%"><img src="images/logo.png" alt="logo"></td>
						</tr>
						       
						<tr valign="bottom"  align="center">
                            <td><a href="home.php"><img style="border-width:0px;" src="images/btn_home.png"  alt="HOME"></a></td>
                            <td><a href="network.php"><img style="border-width:0px;" src="images/btn_network.png" alt="Network Setting"></a></td>
                            <td><a href="update.php"><img style="border-width:0px;" src="images/btn_update.png" alt="Update"></a></td>
                            <td><a href="setting.php"><img style="border-width:0px;" src="images/btn_setting.png" alt="setting"></a></td>
                           <td><a href="filemanage.php"><img style="border-width:0px;" src="images/btn_filemanage.png" alt="File Manage"></a></td>
                        </tr>
                    </table>
               	</td>
            </tr> 
			<tr>
                <td colspan="2">
					<table border="0" cellspacing="0" cellpadding="0"></table>
				</td>
			</tr>
            <tr>
            	<td colspan="2" valign="middle" bgcolor="#FFFFFF">
					<table border="0" cellspacing="0" cellpadding="0"  width="780px" class="form_table">
                    	<tr> 
                        <td width="3%" >&nbsp;</td>
						<td valign="middle" class="name" style="width:180px;"
><strong class="green-text">Update Page</strong></td>
                          <td  width="350px" colspan="2">&nbsp;</td>
                            <td width="200px" colspan="2">&nbsp;</td>
                      	</tr>
                        
                        <tr>
                            <td width="51">&nbsp;</td>
                            <td valign="middle" class="style1" style="width:140px;"><strong>Update firmware</strong></td>
                            <td colspan="2" width="350px"><input type="file" name="choose_file" value="Choose firmware" id="upFile"  /> </td>
                             <td rowspan="2" width="200px" class="red-text-regular">Infomat will automatically upgrade firmware after reboot 
                               <p></p> </td>
                      	</tr>
                       
                        <tr>
                            <td style="no">&nbsp;</td>
                            <td valign="middle"  style="width:140px;">&nbsp;</td>
						    <td colspan="2" width="350px">&nbsp;</td>
                        </tr>                        
						<tr>
                           <td></td>
                            <td valign="middle"style="width:140px;"><input type="submit" name="btn" value="upload" id="upload" ></td>
                            <td colspan="2" width="350px">&nbsp;</td>
                             <td style="no" align="right"><span style="width: 200px">
                               <input type="submit" name="btn" value="reboot" id="reboot" >
                             </span></td>
                        </tr>
					</table>
				</td>
            </tr>
	    <tr>
		<td colspan="2" align="center" class="white-text">
		    <table width="100%" border="0" cellspacing="0" cellpadding="10">
			<tr>
			<td align="center" class="white-text">Copyright &copy;  Teraoka Weigh System. All Rights Reserved.</td>
			</tr>
		    </table>
		</td>
	    </tr>
	</table>
   </td>
</tr>
</table>

</body>
</html>
